// TOWN SPECIAL ENCOUNTERS
//    Town 29: Under Castle Troglo

beginzonescript;

//123456789

variables;

short im_hostile = 0;
short max_crime = 200;
short last_abil;
short counter = 0;
short set_ter = 0;
short x,y;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

//	set_name(,);
//	add_range_to_group(,,groupn);

	if (gf(29,20) > 0)
		set_terrain(0,47,55,0);
	
	if (gf(307,8) > 0) {
		kill_object(174,1);
		kill_object(175,1);
		kill_object(176,1);
		kill_object(177,1);
		kill_object(178,1);
		}
	
	set_aggression(30001,60);
	set_aggression(30002,60);
	set_aggression(30003,60);
	set_aggression(30004,60);
	set_aggression(30005,60);
	set_aggression(30006,60);
	set_aggression(30007,60);
	set_aggression(30008,60);
	set_aggression(30009,30);
	
	set_name(2922,"Scourge Hynyah");
	set_boss_level(2922,1);
	
	set_name(2939,"Old Elder Ballah");
	
	set_crime_tolerance(max_crime);

	break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
	if (char_ok(get_pc_id(0))) {
		x = char_loc_x(get_pc_id(0));
		y = char_loc_y(get_pc_id(0));
		if ((get_floor(0,x,y) == 48) && (get_terrain(0,x,y) != 186)) {
			teleport_party(15,21,1);
			inc_flag(29,25,1);
			damage_char(30000,get_ran(1 + gf(29,25),1,25),1);
			play_sound(172);
			ok_dlog(70,1);
			}
		}
	if (char_ok(get_pc_id(1))) {
		x = char_loc_x(get_pc_id(1));
		y = char_loc_y(get_pc_id(1));
		if ((get_floor(0,x,y) == 48) && (get_terrain(0,x,y) != 186)) {
			teleport_party(15,21,1);
			inc_flag(29,25,1);
			damage_char(30000,get_ran(1 + gf(29,25),1,25),1);
			play_sound(172);
			ok_dlog(70,1);
			}
		}
	if (char_ok(get_pc_id(2))) {
		x = char_loc_x(get_pc_id(2));
		y = char_loc_y(get_pc_id(2));
		if ((get_floor(0,x,y) == 48) && (get_terrain(0,x,y) != 186)) {
			teleport_party(15,21,1);
			inc_flag(29,25,1);
			damage_char(30000,get_ran(1 + gf(29,25),1,25),1);
			play_sound(172);
			ok_dlog(70,1);
			}
		}
	if (char_ok(get_pc_id(3))) {
		x = char_loc_x(get_pc_id(3));
		y = char_loc_y(get_pc_id(3));
		if ((get_floor(0,x,y) == 48) && (get_terrain(0,x,y) != 186)) {
			teleport_party(15,21,1);
			inc_flag(29,25,1);
			damage_char(30000,get_ran(1 + gf(29,25),1,25),1);
			play_sound(172);
			ok_dlog(70,1);
			}
		}
break;

beginstate 10;
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

beginstate 14;
break;

//	print_str("");
//	set_terrain_string_range("",1);
//	set_terrain_string_range("The sign says - .",1);

